import request from "../utils/request"
import utils from "../utils/util.js"
export default {

	/**
	 * 附近车辆
	 * @param {Object} query
	 */
	getVehiclesList(query) {
		const queryParmas = utils.addParamsToURL(query);
		return request.get(`/system/vehicles/list?${queryParmas}`);
	},

	addVehicles(data) {
		return request.post('/system/vehicles', data);
	},

	getVehiclesById(id) {
		return request.get(`/system/vehicles/${id}`)
	},
	delVehiclesById(id) {
		return request.request(`/system/vehicles/${id}`, 'DELETE')
	},

	/**
	 * 宠物计划
	 * @param {Object} query
	 */
	getPetPlanList(query) {
		const queryParmas = utils.addParamsToURL(query);
		return request.get(`/system/plan/list?${queryParmas}`);
	},

	addPetPlan(data) {
		return request.post('/system/plan', data);
	},

	getPetPlanById(id) {
		return request.get(`/system/plan/${id}`)
	},

	delPetPlanById(id) {
		return request.request(`/system/plan/${id}`, 'DELETE')
	},

	/**
	 * 司机计划
	 * @param {Object} query
	 */
	getDriverPlanList(query) {
		const queryParmas = utils.addParamsToURL(query);
		return request.get(`/system/driverplan/list?${queryParmas}`);
	},

	addDriverPlan(data) {
		return request.post('/system/driverplan', data);
	},

	getDriverPlanById(id) {
		return request.get(`/system/driverplan/${id}`)
	},

	delDriverPlanById(id) {
		return request.request(`/system/driverplan/${id}`, 'DELETE')
	},

	/**
	 * 出行申请
	 */
	addGoApplay(data) {
		return request.post('/system/travel', data);
	}
}